<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script src="/static/jQuery-3.3.1.js"></script>
    <link rel="stylesheet" href="/static/bootstrap-3.3.7-dist/css/bootstrap.css">
    <title>Title</title>
</head>
<body>

<div class="container">
    <div class="row">
        <div class="col-md-6 col-md-offset-3">
            <table class="table">
                <tr>
                    <th>id</th>
                    <th>书名</th>
                    <th>价格</th>
                </tr>
                {% for pages in get_page %}
                    <tr>
                        <td>{{ forloop.counter }}</td>
                        <td>{{ pages.name }}</td>
                        <td>{{ pages.pirce }}</td>
                    </tr>
                {% endfor %}
            </table>
        </div>
        <div class="col-md-8 col-md-offset-3 ">
            <div class="center-block">
                <nav aria-label="Page navigation">
                    <ul class="pagination">
                        {% if get_page.has_previous %}
                            <li>
                                <a href="{% url 'page_list' %}?page_num={{ get_page.previous_page_number }}"
                                   aria-label="Previous">
                                    <span aria-hidden="true">下一页</span>
                                </a>
                            </li>
                        {% else %}
                            <li class="disabled">
                                <a href="#" aria-label="Previous" class="disabled">
                                    <span aria-hidden="true">上一页</span>
                                </a>
                            </li>
                        {% endif %}

                        {% for page in page_range %}
                                {% if page_num == page %}
                                    <li class="active"><a
                                            href="{% url 'page_list' %}?page_num={{ page }}">{{ page }}</a></li>
                                {% else %}
                                    <li><a href="{% url 'page_list' %}?page_num={{ page }}">{{ page }}</a></li>
                                {% endif %}
                        {% endfor %}


                        {% if get_page.has_next %}
                            <li>
                                <a href="{% url 'page_list' %}?page_num={{ get_page.next_page_number }}"
                                   aria-label="Next">
                                    <span aria-hidden="true">下一页</span>
                                </a>
                            </li>
                        {% else %}
                            <li class="disabled">
                                <a href="#" aria-label="Next" class="disabled">
                                    <span aria-hidden="true">下一页</span>
                                </a>
                            </li>
                        {% endif %}

                    </ul>
                </nav>
            </div>

        </div>
    </div>
</div>


</body>
</html>